Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add language support for en, de, es, fr, hi, pt, it, ja, ru, zh and more #223

Merged
merged 24 commits into from
Nov 14, 2024

Conversation

Fintasys
Copy link
Owner

@Fintasys Fintasys commented Nov 8, 2024

closes: #203

Description

Usage

EmojiPicker(
         textEditingController: _controller,
         scrollController: _scrollController,
         config: Config(
             emojiSet: _getEmojiLocale,
        ),
)

List<CategoryEmoji> _getEmojiLocale(Locale locale) {
  switch (locale.languageCode) {
    case "ja":
      return emojiSetJapanese;
    case "de":
      return emojiSetGerman;
    default:
      return emojiSetEnglish;
  }
}

@Fintasys Fintasys self-assigned this Nov 8, 2024
@Fintasys Fintasys mentioned this pull request Nov 8, 2024
@emavgl
Copy link

emavgl commented Nov 8, 2024

About the usage: wouldn't be possible to pass just the Locale object and the library behind the hood fetch the correct set?

@Fintasys
Copy link
Owner Author

Fintasys commented Nov 8, 2024

@emavgl It's possible but it would remove the possibility to users to add other languages by their own

@emavgl
Copy link

emavgl commented Nov 8, 2024

EmojiPicker(
textEditingController: _controller,
scrollController: _scrollController,
config: Config(
emojiSet: _getEmojiLocale(locale),
),
)

I would still keep emojiSet so if the user wants to do some change, they are free to implement _getEmojiLocale(locale) or similar as they want to, in their app.

While in the library you already have the map Locale -> EmojiSet and you can easily achive something like

   config: Config(
       locale: userLocale;
  ),

Where userLocale is an https://api.flutter.dev/flutter/dart-ui/Locale-class.html

@Fintasys
Copy link
Owner Author

Fintasys commented Nov 8, 2024

@emavgl Ah I get it. That's of course also a possibility, thx! I will think about it and make further changes once I got time 🙏

@emavgl
Copy link

emavgl commented Nov 8, 2024

Sure, thank you so much for your work!

@Fintasys Fintasys marked this pull request as ready for review November 10, 2024 22:30
@Fintasys Fintasys changed the title [Draft] Localization script Add language support for en, de, es, fr, it, ja, zh and more Nov 10, 2024
@Fintasys Fintasys changed the title Add language support for en, de, es, fr, it, ja, zh and more Add language support for en, de, es, fr, hi, pt, it, ja, ru, zh and more Nov 12, 2024
@Fintasys Fintasys merged commit b45a14c into master Nov 14, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Localized emoji names
2 participants